function isPrime(num) { if (num <= 1) { return false; } for (let i = 2; i <= Math.sqrt(num); i++) { if (num % i === 0) { return false; } } return true; } function extractPrimes(start, end) { const primes = []; for (let number = start; number <= end; number++) { if (isPrime(number)) { primes.push(number); } } return primes; } function main() { const start = parseInt(prompt("Enter the starting number:")); const end = parseInt(prompt("Enter the ending number:")); if (isNaN(start) || isNaN(end) || start < 0 || end < 0) { console.log("Error: Starting and ending numbers must be positive whole numbers."); } else { const primeNumbers = extractPrimes(start, end); if (primeNumbers.length > 0) { console.log("Prime numbers in the range:", primeNumbers); } else { console.log("No prime numbers found in the specified range."); } } } main();